#include <iostream> 
#include <cstdlib>
#include <cstring>
#include <cstdio>

#define BASE 1000000000 // Base del número
#define DIGITS 9	// Cant. de digitos para cada cifra
#define SIZE 3000	// Cant. de cifras del numero, en base BASE
#define PLUS 1
#define MINUS -1

using namespace std;

typedef long long data_type;

class BigInt{
	public:
		data_type num[SIZE];
		int offset;
		char sign;		

		BigInt();
		BigInt(long long );
		BigInt(const BigInt & ); //constructor por copia!!
		BigInt(char *, const int );
		
		BigInt &operator<<=(const int );
		BigInt operator+(BigInt& );
		BigInt operator-(BigInt& );
		BigInt operator/(BigInt& );
		BigInt operator*(BigInt& );
		BigInt operator%(BigInt& );

		bool operator>(const BigInt& );
		bool operator<(const BigInt& );
		bool operator>=(const BigInt& );
		bool operator<=(const BigInt& );
		bool operator==(const BigInt& );
		bool operator!=(const BigInt& );

		BigInt &operator=(const BigInt& );

		void print();
		void zero_justify();
};

BigInt mcd(BigInt &, BigInt & );
BigInt mcm(BigInt &, BigInt & );
BigInt pow(BigInt &, long long );

int main(){

	char num[SIZE];
	char num2[SIZE];
	char op;

	while(cin >> num >> op >> num2){
		BigInt n1(num,strlen(num));	
		BigInt n2(num2, strlen(num2));
		BigInt r;
		
		switch(op){
			case '+':
				r = n1 + n2;
				cout << endl;
				r.print();
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case '-':
				r = n1 - n2;
				cout << endl;
				r.print();
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case '*':
				r = n1 * n2;
				cout << endl;
				r.print();
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case '/':
				r = n1 / n2;
				cout << endl;
				r.print();
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case '%':
				r = n1 % n2;
				cout << endl;
				r.print();
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case 'D':
				r = mcd(n1, n2);
				cout << endl;
				r.print();
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case 'm':
				r = mcm(n1, n2);
				cout << endl;
				r.print();
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case 'p':
				r = pow(n1, atol(num2));
				cout << endl;
				r.print();
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case '>':
				cout << endl << (n1 > n2) << endl;
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case '<':
				cout << endl << (n1 < n2) << endl;
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case 'g':
				cout << endl << (n1 >= n2) << endl;
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case 'l':
				cout << endl << (n1 <= n2) << endl;
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case '=':
				cout << endl << (n1 == n2) << endl;
				cout<<endl<< "---------------------" << endl << endl;
				break;
			case 'n':
				cout << endl << (n1 != n2) << endl;
				cout<<endl<< "---------------------" << endl << endl;
				break;
		}
	}

	return 0;
}

BigInt::BigInt(){
	num[SIZE-1] = 0;
	offset = SIZE-1;
	sign = PLUS;
}

BigInt::BigInt(long long n){
	if(n >= 0)
		sign = PLUS;
	else{
		sign = MINUS;
		n = -n;
	}
	
	int i = SIZE-1;
	
	if(n == 0)
		num[i--] = 0;
	
	while(n > 0){
		num[i--] = n % BASE;
		n /= BASE;
	}
	offset = ++i;
}

BigInt::BigInt(char* n, int size){
	int it = size; //itera sobre el char*	
	int end = 0;
	char temp = '\0';
	int i = SIZE - 1; //itera sobre el num
	
	if(n[0] == '-'){
		sign = MINUS;
		end = 1;
	}
	else {
		sign = PLUS;
	}
	
	if(strcmp(n,"0") == 0 || strcmp(n,"+0") == 0 || strcmp(n,"-0") == 0 ) {
		num[i] = 0;
		sign = PLUS;
	} else {
		while(it > end + DIGITS) {
			it -= DIGITS;
			num[i--] = atol(&n[it]);
			
			if(it+DIGITS != size)
				n[it+DIGITS] = temp;
				
			temp = n[it];
			n[it] = '\0';
		}
		
		num[i] = atol(&n[end]);
		n[strlen(n)] = temp;
	}
	
	offset = i;
}

BigInt::BigInt(const BigInt &b){
	this->offset = b.offset;
	this->sign = b.sign;
	
	memcpy(this->num, b.num, sizeof(b.num));
}

bool BigInt::operator>(const BigInt &b){
	// preguntar por el signo.
	if(this->sign != b.sign){
		return this->sign == PLUS;
	}
	// preguntar por los offset.
	if(this->offset != b.offset){
		if(this->sign == PLUS){
			return this->offset < b.offset;
		} else{
			return this->offset > b.offset;
		}
	}
	// comparar cuando tiene el mismo signo y el mismo offset
	int ds = offset;
	
	while (ds < SIZE && this->num[ds] == b.num[ds]) ds++;
	
	if(ds == SIZE) return false; // son iguales
	
	if(this->sign == PLUS){
		return this->num[ds] > b.num[ds];
	} else{
		return this->num[ds] < b.num[ds];
	}
}

bool BigInt::operator<(const BigInt &b){
	// preguntar por el signo.
	if(this->sign != b.sign){
		return this->sign == MINUS;
	}
	// preguntar por los offset.
	if(this->offset != b.offset){
		if(this->sign == PLUS){
			return this->offset > b.offset;
		} else{
			return this->offset < b.offset;
		}
	}
	// comparar cuando tiene el mismo signo y el mismo offset
	int ds = offset;
	
	while (ds < SIZE && this->num[ds] == b.num[ds]) ds++;
	
	if(ds == SIZE) return false; // son iguales
	
	if(this->sign == PLUS){
		return this->num[ds] < b.num[ds];
	} else{
		return this->num[ds] > b.num[ds];
	}
}

bool BigInt::operator>=(const BigInt &b){
	// preguntar por el signo.
	if(this->sign != b.sign){
		return this->sign == PLUS;
	}
	// preguntar por los offset.
	if(this->offset != b.offset){
		if(this->sign == PLUS){
			return this->offset < b.offset;
		} else{
			return this->offset > b.offset;
		}
	}
	// comparar cuando tiene el mismo signo y el mismo offset
	int ds = offset;
	
	while (ds < SIZE && this->num[ds] == b.num[ds]) ds++;
	
	if(ds == SIZE) return true; // son iguales
	
	if(this->sign == PLUS){
		return this->num[ds] > b.num[ds];
	} else{
		return this->num[ds] < b.num[ds];
	}
}

bool BigInt::operator<=(const BigInt &b){
	// preguntar por el signo.
	if(this->sign != b.sign){
		return this->sign == MINUS;
	}
	// preguntar por los offset.
	if(this->offset != b.offset){
		if(this->sign == PLUS){
			return this->offset > b.offset;
		} else{
			return this->offset < b.offset;
		}
	}
	// comparar cuando tiene el mismo signo y el mismo offset
	int ds = offset;
	
	while (ds < SIZE && this->num[ds] == b.num[ds]) ds++;
	
	if(ds == SIZE) return true; // son iguales
	
	if(this->sign == PLUS){
		return this->num[ds] < b.num[ds];
	} else{
		return this->num[ds] > b.num[ds];
	}
}

bool BigInt::operator==(const BigInt &b){
// preguntar por el signo.
	if(this->sign != b.sign){
		return false;
	}
	// preguntar por los offset.
	if(this->offset != b.offset){
		return false;
	}
	// comparar cuando tiene el mismo signo y el mismo offset
	int ds = offset;
	
	while (ds < SIZE && this->num[ds] == b.num[ds]) ds++;
	
	return ds == SIZE;
}

bool BigInt::operator!=(const BigInt &b){
// preguntar por el signo.
	if(this->sign != b.sign){
		return true;
	}
	// preguntar por los offset.
	if(this->offset != b.offset){
		return true;
	}
	// comparar cuando tiene el mismo signo y el mismo offset
	int ds = offset;
	
	while (ds < SIZE && this->num[ds] == b.num[ds]) ds++;
	
	return ds < SIZE;
}

BigInt& BigInt::operator=(const BigInt &b){
	this->offset = b.offset;
	this->sign = b.sign;

	memcpy(this->num, b.num, sizeof(b.num));
	
	return *this;
}

BigInt& BigInt::operator<<=(const int d){
	if(num[offset] == 0) return *this;
	
	int i = offset - d;
	int limit = SIZE - d;
	for(; i < limit; i++)
		num[i] = num[i + d];
	for(; i < SIZE; i++)
		num[i] = 0;
	offset -= d;
	
	return *this;
}

/*

- -	==>	- (A + B)
- +	==>	- (A - B)
+ -	==>	   A - B
+ +	==>	   A + B

*/
BigInt BigInt::operator+(BigInt &b){
	BigInt res;

	if(this->sign == b.sign){
		if(this->sign == PLUS && this->offset < b.offset ||
			this->sign == MINUS && this->offset > b.offset){
			return (b + *this);
		} 

		data_type c = 0, t;
		int i = SIZE-1;
	
		for(; i >= offset; i--){
			t =  c + num[i] + b.num[i];
			c = t / BASE;
			res.num[i] = t - c * BASE;
		}
			
		for(; i >= b.offset; i--){
			t = c + b.num[i];
			c = t / BASE;
			res.num[i] = t - c * BASE;
		}		
		if(c > 0){
			res.num[i] = c;
			res.offset = i;
		} else 
			res.offset = b.offset;
		
		res.sign = this->sign;
	} else{
		char aSign = this->sign; this->sign = PLUS;
		char bSign = b.sign;		 b.sign = PLUS;
		res = *this - b;
		res.sign *= aSign;
		res.zero_justify();
		this->sign = aSign;
		b.sign = bSign;
	}
	return res;
}

/*

- -	==>	- (A - B)
- +	==>	- (A + B)
+ -	==>	   A + B
+ +	==>	   A - B

*/

BigInt BigInt::operator-(BigInt &b){
	BigInt res;
	BigInt* pA = this;
	BigInt* pB = &b;
	
	if(this->sign == b.sign){
		if((b.sign == PLUS && *this < b) || (b.sign == MINUS && *this > b)){
			pA = &b;
			pB = this;
			res.sign = MINUS;
		}

		int i = SIZE-1;
		data_type temp;
		data_type borrow = 0;
	
		for(; i >= pA->offset; i--){
			temp = (i >= pB->offset) ? (pA->num[i] - borrow - pB->num[i]) : (pA->num[i] - borrow);
			if(pA->num[i] > 0)
				borrow = 0;
			if(temp < 0){
				temp += BASE;
				borrow = 1;
			}
			res.num[i] = temp;
		}

		res.offset = pA->offset;
		res.sign *= this->sign;
		res.zero_justify();
	}
	else{
		char aSign = this->sign; this->sign = PLUS;
		char bSign = b.sign;		 b.sign = PLUS;
		res = *this + b;
		res.sign *= aSign;
		this->sign = aSign;
		b.sign = bSign;		
	}
	return res;
}

BigInt BigInt::operator/(BigInt &b){
	data_type binary_search(BigInt &row, BigInt &b);
	
	if(b.offset == SIZE-1 && b.num[SIZE-1] == 0){
		cout << "ERROR: division por cero" << endl;
		return *this;
	}
	
	BigInt res;
	
	char aSign = this->sign; this->sign = PLUS;
	char bSign = b.sign;		 b.sign = PLUS;
	
	if(*this < b)
		return res;
	
	BigInt row;
	
	res.sign = aSign * bSign;
	
	for(int i=this->offset; i<SIZE; i++){
		row <<= 1;
		row.num[SIZE-1] = this->num[i];
		res <<= 1;
		
		if(row >= b)
			res.num[SIZE - 1] = binary_search(row, b);
	}
	
	this->sign = aSign;
	b.sign = bSign;
	
	return res;
}

data_type binary_search(BigInt &row, BigInt &b){
	BigInt res, mul, zero;
	data_type medio;

	for(data_type desde = 0, hasta = BASE-1; desde <= hasta;) {
		medio = (desde + hasta) / 2;
		BigInt i(medio);
		mul = i * b;
		res =  row - mul;
			
		if(desde == hasta) { 
			if(zero <= res && res < b){
				row = res;
				return medio;
			}
		}
			
		if(zero <= res && res < b){
			row = res;
			return medio;  
		} else if(res < zero) 
			hasta = medio - 1; 
		else 
			desde = medio + 1; 
	}
	return -1;
}
	
BigInt BigInt::operator*(BigInt &b){
	BigInt res;
	BigInt* pA = this;
	BigInt* pB = &b;

	if(this->offset > b.offset){
		pA = &b;
		pB = this;
	}
	
	unsigned delta = 1, pos;

	data_type carry = 0;
	res.offset = -SIZE + pA->offset + pB->offset;

	memset(&res.num[res.offset], 0, sizeof(data_type[SIZE - res.offset]));
	
	for (int i = SIZE - 1; i >= pA->offset;  i--, delta++) {
		pos = SIZE - delta;
		carry = 0;

		for (int j = SIZE - 1; j >= pB->offset;  j--, pos--) {
			res.num[pos] += carry + pB->num[j] * pA->num[i];
			carry = res.num[pos] / BASE;
			res.num[pos] -= carry * BASE;
		}
		res.num[pos] = carry;
	}
	res.num[pos] = carry;

	while (res.num[res.offset] == 0 && res.offset < SIZE-1)
		res.offset++;
	
	res.sign = pA->sign == pB->sign ? PLUS: MINUS;
	res.zero_justify(); 
	
	return res;
}

BigInt BigInt::operator%(BigInt &b){
	if(b.sign == MINUS || this->sign == MINUS ){
		cout << "ERROR: operando negativo" << endl;
		return *this;
	}
	
	BigInt div = *this / b;
	BigInt mul = b * div;
	return *this - mul;
}

void BigInt::zero_justify(){
	for(; num[offset] == 0 && offset < SIZE-1; offset++) ;
	if(offset == SIZE-1 && num[SIZE-1] == 0)
		sign = PLUS;
}

BigInt mcd(BigInt &a, BigInt &b){
	BigInt pA, pB, r;
	
	if(a < b){
		pA = b;
		pB = a;
	}
	else{
		pA = a;
		pB = b;
	}

	while(!(pB.offset == SIZE-1 && pB.num[SIZE-1] == 0)){
		r = pA % pB;
		pA = pB;
		pB = r;
	}
	
	return pA;
}

BigInt mcm(BigInt &a, BigInt &b){
	BigInt r, d = mcd(a, b);
	r = a * b;
	return r / d;
}

BigInt pow(BigInt &a, long long p){
	if(p < 0){
		cout << "ERROR: potencia negativa" << endl;
		return a;
	}
	
	BigInt r(1);
	
	if(p == 0)
		return r;
	if(p == 1)
		return a;
	
	if(p & 1){ // potencia impar
		r = pow(a, p-1);
		return r * a;
	}
	else{ // potencia par
		r = pow(a, p/2);
		return r * r;
	}
}

void BigInt::print(){
	int i = offset;
	int c;
	data_type temp;
	
	if(sign == MINUS) // signo menos
		cout << '-';
	
	cout << num[i++];
	
	while(i < SIZE){
		c = 0;
		temp = num[i];
		while(temp > 0){
			c++;
			temp /= 10;
		}
		for(int j=0; j<DIGITS-c; j++)
			printf("0");
		if(num[i] != 0)
			cout <<num[i];
		i++;
	}
}

